/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.giant.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author taticay
 */
@Entity
@Table(name = "in_size")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "InSize.findAll", query = "SELECT i FROM InSize i"),
    @NamedQuery(name = "InSize.findByIdSize", query = "SELECT i FROM InSize i WHERE i.idSize = :idSize"),
    @NamedQuery(name = "InSize.findByDescription", query = "SELECT i FROM InSize i WHERE i.description = :description")
    })
public class InSize implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_size")
    private Integer idSize;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "description")
    private String description;
    @Basic(optional = false)
    @Column(name = "digit")
    private Integer digit;

    public InSize() {
    }

    public InSize(Integer idSize) {
        this.idSize = idSize;
    }

    public InSize(Integer idSize, int idGlobalCode, String description, int digit) {
        this.idSize = idSize;
        this.description = description;
        this.digit=digit;
    }

    public Integer getIdSize() {
        return idSize;
    }

    public void setIdSize(Integer idSize) {
        this.idSize = idSize;
    }

    public Integer getDigit() {
        return digit;
    }

    public void setDigit(Integer digit) {
        this.digit = digit;
    }
    
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSize != null ? idSize.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InSize)) {
            return false;
        }
        InSize other = (InSize) object;
        if ((this.idSize == null && other.idSize != null) || (this.idSize != null && !this.idSize.equals(other.idSize))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.giant.entities.InSize[ idSize=" + idSize + " ]";
    }
    
}
